A non-volatile semiconductor memory (NVSM) may be employed as mass storage for a computer system (e.g., desktop, laptop, portable, etc.) or a consumer device (e.g., music player, cell phone, camera, etc.) or other suitable application. The NVSM may comprise one or more memory devices (such as a flash memory) and control circuitry for accessing each memory device. Each memory device is coupled to an I/O bus, as well as a number of interface control lines. When issuing a program command or an erase command to a memory device, the control circuitry transfers the address and command data (and write data for a program operation) over the I/O bus. When issuing a read command, the control circuitry transfers the address and command data over the I/O bus and then receives the read data over the I/O bus.
Each memory device typically comprises one or more memory arrays programmed in segments referred to as “pages”. A number of pages are grouped into a “block”, wherein a page is erased by erasing the entire block of pages. Accordingly, different pages of a single block (or partial pages) may be programmed over a number of program cycles before erasing the block with an erase cycle.
A write log is typically maintained that includes address mapping (logical block address to physical block address) as well as the last page written. The write log is periodically written to the NVSM so that it is saved across power cycles. However, when a power failure occurs it may not be possible to save the write log, and therefore the last written block cannot be determined from the write log when the NVSM is powered on. Instead, the NVSM is typically searched to locate the last written page, for example, by searching for a particular pattern that identifies the address of the last written page.